package com.jandn.common.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.jandn.common.dto.LoginInfoDTO;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class BaseAction extends ActionSupport {

	private static final long serialVersionUID = -4091114902113279865L;
	
	protected LoginInfoDTO loginInfoDTO;

	public LoginInfoDTO getLoginInfoDTO() {
		return loginInfoDTO;
	}

	public void setLoginInfoDTO(LoginInfoDTO loginInfoDTO) {
		this.loginInfoDTO = loginInfoDTO;
	}
	
	public Map<String,Object> getSession(){
		return ActionContext.getContext().getSession();
	}
	
	public HttpServletResponse getResponse(){
		return (HttpServletResponse)ActionContext.getContext().get(ServletActionContext.HTTP_RESPONSE);
	}
	
	public HttpServletRequest getRequest(){
		return (HttpServletRequest)ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
	}
}
